/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 页面基础样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #f8fafc;
    color: #1a202c;
    line-height: 1.6;
    overflow: hidden;
}

/* 应用主容器 */
.app-container {
    display: flex;
    height: 100vh;
    background-color: #ffffff;
}

/* 左侧边栏 */
.sidebar {
    width: 200px;
    background-color: #ffffff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
}

/* 侧边栏头部 */
.sidebar-header {
    padding: 20px 16px 16px;
    border-bottom: 1px solid #f1f5f9;
}

/* 应用标题 */
.app-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

/* 侧边栏内容区域 */
.sidebar-content {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

/* 新建对话按钮 */
.new-chat-btn {
    width: 100%;
    height: 44px;
    background-color: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 20px;
}

/* 新建对话按钮悬停效果 */
.new-chat-btn:hover {
    border-color: #cbd5e1;
    background-color: #f8fafc;
    transform: translateY(-1px);
}

/* 新建对话按钮图标 */
.new-chat-btn i {
    font-size: 16px;
}

/* 聊天记录区域 */
.chat-history {
    margin-bottom: 20px;
}

/* 聊天记录标题 */
.chat-history h3 {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 10px;
}

/* 历史记录列表容器 */
.history-list {
    min-height: 60px;
    max-height: 300px;
    overflow-y: auto;
}

/* 无历史记录提示 */
.no-history {
    font-size: 13px;
    color: #94a3b8;
    text-align: center;
    padding: 20px 0;
}

/* 会话列表项 */
.session-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 6px;
    border: 1px solid transparent;
}

/* 会话列表项悬停效果 */
.session-item:hover {
    background-color: #f1f5f9;
    border-color: #e2e8f0;
}

/* 当前选中的会话 */
.session-item.active {
    background-color: #e0e7ff;
    border-color: #667eea;
}

/* 会话信息容器 */
.session-info {
    flex: 1;
    min-width: 0;
}

/* 会话标题 */
.session-title {
    font-size: 12px;
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 会话时间 */
.session-time {
    font-size: 10px;
    color: #64748b;
}

/* 删除会话按钮 */
.delete-session-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

/* 删除按钮悬停效果 */
.delete-session-btn:hover {
    background-color: #fecaca;
    color: #dc2626;
}

/* 记忆管理区域 */
.memory-management h3 {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 10px;
}

/* 记忆管理按钮组 */
.memory-controls {
    display: flex;
    gap: 8px;
}

/* 记忆管理按钮 */
.memory-btn {
    flex: 1;
    height: 36px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* 记忆管理按钮悬停效果 */
.memory-btn:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
}

/* 记忆管理按钮图标 */
.memory-btn i {
    font-size: 12px;
}

/* 侧边栏底部 */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid #f1f5f9;
    background-color: #fafbfc;
}

/* 在线状态显示 */
.status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 16px;
}

/* 状态指示器 */
.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #10b981;
}

/* 在线状态指示器 */
.status-indicator.online {
    background-color: #10b981;
}

/* 底部记忆管理 */
.sidebar-footer .memory-management {
    margin-bottom: 16px;
}

/* 底部记忆管理标题 */
.sidebar-footer .memory-management h3 {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
}

/* 底部记忆管理按钮组 */
.sidebar-footer .memory-controls {
    display: flex;
    gap: 6px;
}

/* 底部记忆管理按钮 */
.sidebar-footer .memory-btn {
    flex: 1;
    height: 32px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 11px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* 底部记忆管理按钮悬停效果 */
.sidebar-footer .memory-btn:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
}

/* 底部记忆管理按钮图标 */
.sidebar-footer .memory-btn i {
    font-size: 10px;
}

/* 主内容区域 */
.main-content {
    flex: 1;
    display: flex;
    background-color: #ffffff;
}

/* 左侧医生展示区域 */
.doctor-section {
    width: 40%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    position: relative;
}

/* 医生头像 */
.doctor-avatar {
    width: 140px;
    height: 140px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 56px;
    margin-bottom: 28px;
    border: 4px solid rgba(255, 255, 255, 0.3);
}

/* 医生区域标题 */
.doctor-section h2 {
    font-size: 24px;
    font-weight: 600;
    color: white;
    margin-bottom: 12px;
}

/* 医生区域描述文字 */
.doctor-section p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    max-width: 300px;
    line-height: 1.6;
}

/* 在线状态显示 */
.online-status {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 14px;
}

/* 状态圆点 */
.status-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    border: 2px solid white;
}

/* 右侧聊天区域 */
.chat-section {
    width: 45%;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
}

/* 聊天消息区域 */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #ffffff;
    border-left: 1px solid #e2e8f0;
}

/* 消息样式 */
.message {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease;
}

/* 消息头像 */
.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* AI消息头像 */
.ai-message .message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 12px;
}

/* 用户消息头像 */
.user-message .message-avatar {
    background-color: #e2e8f0;
    color: #64748b;
    font-size: 12px;
}

/* 消息内容容器 */
.message-content {
    flex: 1;
    max-width: 80%;
}

/* 消息文本气泡 */
.message-text {
    background-color: #f8fafc;
    padding: 8px 12px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    display: inline-block;
    max-width: 100%;
    word-wrap: break-word;
}

/* 消息文本段落 */
.message-text p {
    margin: 0;
    font-size: 13px;
    color: #1e293b;
    line-height: 1.4;
}

/* 消息文本段落间距 */
.message-text p + p {
    margin-top: 4px;
}

/* 消息时间戳 */
.message-time {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 4px;
    text-align: right;
}

/* 用户消息样式 */
.user-message {
    flex-direction: row-reverse;
}

/* 用户消息内容对齐 */
.user-message .message-content {
    text-align: right;
}

/* 用户消息文本对齐 - 修复换行问题 */
.user-message .message-text {
    background-color: #667eea;
    color: white;
    border-color: #667eea;
    text-align: left;
}



/* 用户消息文本颜色 */
.user-message .message-text p {
    color: white;
}

/* 输入区域 */
.chat-input-area {
    padding: 20px;
    background-color: #ffffff;
    border-top: 1px solid #e2e8f0;
    border-left: 1px solid #e2e8f0;
}

/* 输入容器 */
.input-container {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* 聊天输入框 */
.chat-input {
    flex: 1;
    min-height: 48px;
    max-height: 120px;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 24px;
    font-size: 14px;
    color: #1e293b;
    background-color: #ffffff;
    transition: all 0.2s ease;
    resize: none;
    overflow-y: auto;
    line-height: 1.5;
    font-family: inherit;
}

/* 输入框焦点状态 */
.chat-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 输入框占位符 */
.chat-input::placeholder {
    color: #94a3b8;
}

/* 发送按钮 */
.send-btn {
    height: 48px;
    padding: 0 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 24px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

/* 发送按钮悬停效果 */
.send-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

/* 发送按钮激活状态 */
.send-btn:active {
    transform: translateY(0);
}

/* 发送按钮图标 */
.send-btn i {
    font-size: 12px;
}

/* 淡入动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 聊天消息滚动条 */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 侧边栏内容滚动条 */
.sidebar-content::-webkit-scrollbar {
    width: 4px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 2px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

/* 响应式设计 - 移动端 */
@media (max-width: 768px) {
    /* 移动端应用容器 */
    .app-container {
        flex-direction: column;
    }
    
    /* 移动端侧边栏 */
    .sidebar {
        width: 100%;
        height: auto;
        max-height: 300px;
    }
    
    /* 移动端主内容区域 */
    .main-content {
        flex: 1;
        flex-direction: column;
    }
    
    /* 移动端医生区域 */
    .doctor-section {
        width: 100%;
        padding: 20px;
        min-height: 200px;
    }
    
    /* 移动端聊天区域 */
    .chat-section {
        width: 100%;
    }
    
    /* 移动端医生头像 */
    .doctor-avatar {
        width: 80px;
        height: 80px;
        font-size: 32px;
    }
    
    /* 移动端医生区域标题 */
    .doctor-section h2 {
        font-size: 20px;
    }
    
    /* 移动端医生区域描述 */
    .doctor-section p {
        font-size: 14px;
    }
}

/* 加载状态 */
.loading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    font-size: 13px;
}

/* 加载动画 */
.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 旋转动画 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 错误消息样式 */
.error-message {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}

/* 工具提示 */
.tooltip {
    position: relative;
    cursor: help;
}

/* 工具提示内容 */
.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1e293b;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
}

/* 工具提示悬停显示 */
.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
} 